package com.stox.ui.swing.launcher;

import javax.swing.SwingUtilities;

import org.springframework.context.ApplicationContext;

import com.stox.ui.swing.widget.MainFrame;
import com.stox.util.ApplicationContextUtil;

public class MainClass {

	public static void main(String args[]){
		try{
			
			System.setProperty("path.filebase", "D:\\stox1\\filebase");
			System.setProperty("path.database","D:\\stox1\\database\\db.db4o");
			System.setProperty("path.message","D:\\stox1\\resource\\message");
			System.setProperty("path.image","D:\\stox1\\resource\\image");
			System.setProperty("path.library","D:\\stox1\\library");
			
			Thread.currentThread().setContextClassLoader(new StoxClassLoader());
			SwingUtilities.invokeLater(new Runnable(){
				@Override
				public void run() {
					ApplicationContext applicationContext = ApplicationContextUtil.loadApplicationContext();
					
					MainFrame mainFrame = applicationContext.getBean(MainFrame.class);
					mainFrame.setVisible(true);
				}
			});
		
			
		}catch(Throwable t){
			t.printStackTrace();
		}
	}
	
}
